package com.ruoyi.zsyh.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.IdWorker;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.zsyh.mapper.ZsyhAfterFactoryMapper;
import com.ruoyi.zsyh.domain.ZsyhAfterFactory;
import com.ruoyi.zsyh.service.IZsyhAfterFactoryService;
import com.ruoyi.common.core.text.Convert;

/**
 * 售后厂家Service业务层处理
 * 
 * @author yuexl
 * @date 2022-08-22
 */
@Service
public class ZsyhAfterFactoryServiceImpl implements IZsyhAfterFactoryService 
{
    @Autowired
    private ZsyhAfterFactoryMapper zsyhAfterFactoryMapper;

    /**
     * 查询售后厂家
     * 
     * @param id 售后厂家ID
     * @return 售后厂家
     */
    @Override
    public ZsyhAfterFactory selectZsyhAfterFactoryById(String id)
    {
        return zsyhAfterFactoryMapper.selectZsyhAfterFactoryById(id);
    }

    /**
     * 查询售后厂家列表
     * 
     * @param zsyhAfterFactory 售后厂家
     * @return 售后厂家
     */
    @Override
    public List<ZsyhAfterFactory> selectZsyhAfterFactoryList(ZsyhAfterFactory zsyhAfterFactory)
    {
        return zsyhAfterFactoryMapper.selectZsyhAfterFactoryList(zsyhAfterFactory);
    }

    /**
     * 新增售后厂家
     * 
     * @param zsyhAfterFactory 售后厂家
     * @return 结果
     */
    @Override
    public int insertZsyhAfterFactory(ZsyhAfterFactory zsyhAfterFactory)
    {
        /*zsyhAfterFactory.setId(IdWorker.getId());*/
        zsyhAfterFactory.setCreateTime(DateUtils.getNowDate());
        return zsyhAfterFactoryMapper.insertZsyhAfterFactory(zsyhAfterFactory);
    }

    /**
     * 修改售后厂家
     * 
     * @param zsyhAfterFactory 售后厂家
     * @return 结果
     */
    @Override
    public int updateZsyhAfterFactory(ZsyhAfterFactory zsyhAfterFactory)
    {
        zsyhAfterFactory.setUpdateTime(DateUtils.getNowDate());
        return zsyhAfterFactoryMapper.updateZsyhAfterFactory(zsyhAfterFactory);
    }

    /**
     * 删除售后厂家对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteZsyhAfterFactoryByIds(String ids)
    {
        return zsyhAfterFactoryMapper.deleteZsyhAfterFactoryByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除售后厂家信息
     * 
     * @param id 售后厂家ID
     * @return 结果
     */
    @Override
    public int deleteZsyhAfterFactoryById(String id)
    {
        return zsyhAfterFactoryMapper.deleteZsyhAfterFactoryById(id);
    }
}
